#pragma once

#include <sstream>
#include <string>

namespace TestFramework
{
    template <typename StringType, typename T>
    StringType ToString(T val)
    {
        std::ostringstream oss;
        oss << val;
        return StringType(oss.str().c_str());
    }

    template <typename T>
    std::size_t GetStrLength(const T* value)
    {
        std::size_t length = 0;
        while (value[length] != '\0')
        {
            ++length;
        }

        return length;
    }

    template <typename T>
    T* StrCopy(const T* value)
    {
        const std::size_t length = GetStrLength(value);
        T* str = new T[length + 1]();
        for (std::size_t i = 0; i < length; ++i)
        {
            str[i] = *(value + i);
        }

        str[length] = '\0';
        return str;
    }
}
